﻿<%@ Page Language="C#" Inherits="System.Web.Mvc.ViewPage" %>

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head id="Head1" runat="server">
    <title>CK Editer Picture Manager</title>
    <link type="text/css" href="../../Content/csseditor/SFI.css" rel="Stylesheet" />
    <link href="../../Content/csseditor/CkEditorManagerPic.css" rel="stylesheet" type="text/css" />
    <link href="../../Content/csseditor/jquery-ui-1.8.custom.css" rel="stylesheet" type="text/css" />

    <script type="text/javascript" src="../../Content/js/AjaxUltities.js"></script>

</head>
<body>
    <form enctype="multipart/form-data" method="post">
    <div class="w_container m10-tb sfi-content fl ">
        <div id="PictureContainer">
            <div class="sub_container fl">
                <% if (ViewData["message"] == null)
                   {%>
                <input type="hidden" id="fucNum" name="fucNum" value="<%=(int) ViewData["funcNum"]%>" />
                <div>

                    <script src="../../Scripts/jquery-1.4.2.min.js" type="text/javascript"></script>

                    <script type="text/javascript" src="../../Scripts/jquery.toJSON.min.js"></script>

                    <script type="text/javascript" language="javascript">
                        function ShowUrl(ab) {
                            //alert($('#fucNum')[0].value);
                            window.opener.CKEDITOR.tools.callFunction($('#fucNum')[0].value, ab);
                            window.close();
                        }
                    </script>

                    <div id="picturesBox" style="background-color: white; text-align: center;">
                        <%
                            var index = 0;
                            foreach (var s in (List<string>)ViewData["items"])
                            {
                                var path = s.Replace((String)ViewData["folderThumbsPath"], (String)ViewData["folderImagesPath"]);
                        %>
                        <%
                            if (!string.IsNullOrEmpty((string)s))
                            {
                                index = index + 1;
                        %>
                        <div class="fl imgContent">
                            <img class="fl" width="100px" height="100px" name='<%=ResolveUrl(s)%>' id="<%=Html.Encode(index)%>" onclick="ShowUrl('<%=ResolveUrl(path)%>')"
                                src='<%=ResolveUrl(s)%>' />

                        </div>
                        <%
                            }%>
                        <%
                            }%>
                    </div>
                </div>
                <%
                    }
                   else
                   {

                %>
                <div class="fl w_container m20-tb">
                    <%=ViewData["message"]%>
                </div>
                <%
                    }%>
                <div class="line-w fl m10-tb">
                </div>
                <div class="fl w_container m20-tb">
                    <div class="title-item fl">
                        UpLoad Hình ảnh:
                    </div>
                    <div class="m10-tb input-item" align="center">
                        <input type="file" name="uploadFile" id="uploadFile" />
                        <input type="submit" name="submit" value="Upload" style="text-align: left" />
                        <div class="error fl">
                            <%= ViewData["messageUpload"]%>
                        </div>
                    </div>
                </div>
            </div>
        </div>
    </div>
    </form>
</body>
</html>
